﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<title>无线点餐平台</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<script type="text/javascript" src="/style/js/jquery.js"></script>
	<script type="text/javascript" src="/style/js/page_common.js"></script>
	<link href="/style/css/common_style_blue.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" type="text/css" href="/style/css/index_1.css"/>
	<script type="application/javascript">

		function gopage(pageIndex) {
			var f=document.getElementById("ff");
			f.action="/food_queryList/"+pageIndex+"/5";
			f.submit();
		}
		function delcx() {
			return confirm("确定要删除这条记录吗？")
		}

	</script>
</head>
<body>
<!-- 页面标题 -->
<div id="TitleArea">
	<div id="TitleArea_Head"></div>
	<div id="TitleArea_Title">
		<div id="TitleArea_Title_Content">
			<img border="0" width="13" height="13" src="/style/images/title_arrow.gif"/> 菜品列表
		</div>
	</div>
	<div id="TitleArea_End"></div>
</div>
<!-- 过滤条件 -->
<div id="QueryArea">
	<form action="/food_queryList/1/2" method="post" id="ff">
		<input type="text" name="title" placeholder="请输入菜品名称" th:value="${food.title}">
		<input type="submit" value="搜索">
	</form>
</div>
<!-- 主内容区域（数据列表或表单显示） -->
<div id="MainArea">
	<table class="MainArea_Content" align="center" cellspacing="0" cellpadding="0">
		<!-- 表头-->
		<thead>
		<tr align="center" valign="middle" id="TableTitle">
			<td>菜编号</td>
			<td>菜名</td>
			<td>图片</td>
			<td>所属菜系</td>
			<td>价格</td>
			<td>会员价格</td>
			<td>操作</td>
		</tr>
		</thead>
		<!--显示数据列表 -->
		<tbody id="TableData">
		<tr class="TableDetail1" th:each="food:${pageUtils.records}">
			<td th:text="${food.id}"></td>
			<td th:text="${food.title}"></td>
			<td>
				<img th:src="|/upload/${food.photo}|" style="width: 100px;"/>
			</td>
			<td th:text="${food.foodtype.name}"></td>
			<td th:text="${food.price}"></td>
			<td th:text="${food.vip_price}"></td>
			<td>
				<a th:href="|/food_toupdate/${food.id}|" class="FunctionButton">更新</a>
				<a th:href="|/food_delete/${food.id}|" onClick="return delcx();"
				   class="FunctionButton">删除</a>
			</td>
		</tr>
		</tbody>
	</table>

	<!-- 其他功能超链接 -->
	<div id="TableTail" align="center">
		<div class="FunctionButton"><a href="/page_saveFood">添加</a></div>
		<a href="javascript:gopage(1);">首页</a>
		<a th:href="|javascript:gopage(${(pageUtils.pageIndex)-1});|" th:if="${pageUtils.pageIndex>1}">上一页</a>
		<a th:href="|javascript:gopage(${(pageUtils.pageIndex)+1});|" th:if="${pageUtils.pageIndex<pageUtils.pageCount}">下一页</a>
		<a th:href="|javascript:gopage(${pageUtils.pageCount});|">尾页</a>
		当前[[${pageUtils.pageIndex}]]/[[${pageUtils.pageCount}]]页
		共[[${pageUtils.totalCount}]]条
	</div>
</div>
</body>
</html>
